package com.qdu.controller;

import java.math.BigInteger;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qdu.entity.Bussiness;
import com.qdu.entity.Job;
import com.qdu.entity.Usert;
import com.qdu.service.BussinessService;
import com.qdu.service.UsertService;

@Controller
@CrossOrigin
@ResponseBody
public class TestController {
	@Autowired
	BussinessService bs;
	@Autowired
	UsertService us;

	@RequestMapping("/test2")
	@ResponseBody
	public Bussiness get(@RequestParam Map<String, Object> map) {
		// System.out.println(map);
		String bid1 = (String) map.get("bid");
		BigInteger bid = new BigInteger(bid1);
		Bussiness b = bs.getBussinessById(bid);
		return b;

	}

	@PostMapping("/test3")
	public Usert insertUsert(Usert user) {
		us.addUsert(user);
		return user;
	}


}

